<template>
	<div>
		<ProcessCompObjectManager
			v-if="config.compCode"
			:compCode="config.compCode"
			:readonly="true"
			:connected="true"
			:compVersion="config.compVersion"/>
	</div>
</template>

<script setup>
import ProcessCompObjectManager from '@/views/comp/ProcessCompObjectManager.vue'

const props = defineProps(['lf', 'nodeId'])

const config = ref({
	compCode: null,
	compVersion: '1.0.0'
})
// watch(
// 	() => props.nodeId,
// 	(newValue, oldValue) => {
// 		getCompCode()
// 		objManager.value.loadZip(config.value.compCode, config.value.compVersion, false, true)
// 	}
// )
onMounted(() => {
	getCompCode()
})

const getCompCode = () => {
	let node = props.lf.getNodeModelById(props.nodeId)
	config.value.compCode = node.properties?.component?.type
}
</script>

<style scoped lang="less">
</style>
